package com.dycn.model;

import lombok.Getter;
import lombok.Setter;

import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.Date;
@Getter
@Setter
public class ActivitysVo {
    private Integer id;

    private String pagetitle;

    private String title;

    private String content;

    private Integer status;

    private Integer delflag;

    private Integer type;

    private String startDate;

    private String endDate;
    private  String pictures;
    public  Activitys toActivitys(){
        Activitys activitys=new Activitys();
        activitys.setId(id);
        activitys.setPagetitle(pagetitle);
        activitys.setTitle(title);
        activitys.setContent(content);
        activitys.setStatus(status);
        activitys.setDelflag(delflag);
        activitys.setType(type);
        activitys.setPictures(pictures);
        SimpleDateFormat simpleDateFormat=new SimpleDateFormat("yyyy-MM-dd");
        try {
            activitys.setStartDate(simpleDateFormat.parse(startDate));
            activitys.setEndDate(simpleDateFormat.parse(endDate));
        } catch (ParseException e) {
            e.printStackTrace();
        }
        return  activitys;
    }

}